{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "47248714",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d847dc6d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 加载男生体测成绩\n",
    "test_m = pd.read_excel('./18级高一体测成绩汇总.xls')\n",
    "# 加载女生体测成绩\n",
    "test_w = pd.read_excel('./18级高一体测成绩汇总.xls',sheet_name=1)\n",
    "# 加载评分标准表\n",
    "score_table = pd.read_excel('./体侧成绩评分表.xls',header = [0,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "ac271644",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(477, 11)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d6c2f7f0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(593, 11)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f6d438ee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'13</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>2785</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'16</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11</td>\n",
       "      <td>7</td>\n",
       "      <td>3133</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'09</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>3901</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'21</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>4946</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3'44</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13</td>\n",
       "      <td>9</td>\n",
       "      <td>3538</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   班级 性别 男1000米跑  男50米跑    男跳远  男体前屈  男引体  男肺活量     身高    体重  BMI\n",
       "0   1  男    4'13   8.88  195.0    12    1  2785  170.0  72.6    0\n",
       "1   1  男    4'16   7.70  225.0    11    7  3133  174.0  52.7    0\n",
       "2   1  男    4'09   8.45  218.0    14    1  3901  169.0  46.5    0\n",
       "3   1  男    4'21   8.05  206.0    13    1  4946  183.0  79.7    0\n",
       "4   1  男    3'44   7.52  210.0    13    9  3538  171.0  54.7    0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e847e713",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重  BMI\n",
       "0   1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3    0\n",
       "1   1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6    0\n",
       "2   1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0    0\n",
       "3   1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7    0\n",
       "4   1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9    0"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "0a39af97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">男肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男体前屈</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女跳远</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男引体</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女仰卧</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男1000米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女800米跑</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>...</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>100</td>\n",
       "      <td>3'24\"</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3'35\"</td>\n",
       "      <td>95</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3'40\"</td>\n",
       "      <td>90</td>\n",
       "      <td>3'36\"</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3'47\"</td>\n",
       "      <td>85</td>\n",
       "      <td>3'43\"</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>80</td>\n",
       "      <td>3'50\"</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   男肺活量       女肺活量      男50米跑      女50米跑       男体前屈       ...  女跳远        男引体  \\\n",
       "     成绩   分数    成绩   分数    成绩   分数    成绩   分数    成绩   分数  ...   成绩   分数    成绩   \n",
       "0  4540  100  3150  100   7.1  100   7.8  100  23.6  100  ...  204  100  16.0   \n",
       "1  4420   95  3100   95   7.2   95   7.9   95  21.5   95  ...  198   95  15.0   \n",
       "2  4300   90  3050   90   7.3   90   8.0   90  19.4   90  ...  192   90  14.0   \n",
       "3  4050   85  2900   85   7.4   85   8.3   85  17.2   85  ...  185   85  13.0   \n",
       "4  3800   80  2750   80   7.5   80   8.6   80  15.0   80  ...  178   80  12.0   \n",
       "\n",
       "       女仰卧      男1000米跑      女800米跑       \n",
       "    分数  成绩   分数      成绩   分数     成绩   分数  \n",
       "0  100  53  100   3'30\"  100  3'24\"  100  \n",
       "1   95  51   95   3'35\"   95  3'30\"   95  \n",
       "2   90  49   90   3'40\"   90  3'36\"   90  \n",
       "3   85  46   85   3'47\"   85  3'43\"   85  \n",
       "4   80  43   80   3'55\"   80  3'50\"   80  \n",
       "\n",
       "[5 rows x 24 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score_table.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "1bff33b1",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 去重\n",
    "test_m.drop_duplicates(inplace=True) \n",
    "test_w.drop_duplicates(inplace=True) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "17518218",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(473, 11)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "bb60c713",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(591, 11)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "3e1265be",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 重新设置行索引\n",
    "test_m.reset_index(inplace=True)\n",
    "test_w.reset_index(inplace=True) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7fe938d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "def convert(x):\n",
    "    if len(str(x)) > 1:\n",
    "        return x\n",
    "    else:\n",
    "        return str(x)+'\\'0'\n",
    "# 男 1000 米跑 变成 float 类型的值\n",
    "# 获取分钟数\n",
    "test_min = test_m['男1000米跑'].map(convert).str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:int(x))[0]\n",
    "# 获取秒转换为分钟数\n",
    "test_sec = test_m['男1000米跑'].map(convert).str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:int(x))[1] / 60\n",
    "test_m['男1000米跑'] = test_min + test_sec.round(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "50b62454",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      4.2\n",
       "1      4.3\n",
       "2      4.2\n",
       "3      4.4\n",
       "4      3.7\n",
       "      ... \n",
       "468    5.0\n",
       "469    4.4\n",
       "470    5.3\n",
       "471    3.4\n",
       "472    4.6\n",
       "Name: 男1000米跑, Length: 473, dtype: float64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m['男1000米跑']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "f6c58b44",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 评分标准中男 1000 米跑和女 800 米跑 变成 float 类型的值\n",
    "# 获取分钟数\n",
    "score_table_min = score_table['男1000米跑']['成绩'].str.replace('\"','')\\\n",
    "                                                   .map(convert).str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:int(x))[0]\n",
    "# 获取秒转换为分钟数\n",
    "score_table_sec = score_table['男1000米跑']['成绩'].str.replace('\"','')\\\n",
    "                                                   .map(convert).str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:int(x))[1] / 60\n",
    "score_table.loc[:,('男1000米跑','成绩')] = score_table_min + score_table_sec.round(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "8c530158",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     3.5\n",
       "1     3.6\n",
       "2     3.7\n",
       "3     3.8\n",
       "4     3.9\n",
       "5     4.0\n",
       "6     4.1\n",
       "7     4.2\n",
       "8     4.2\n",
       "9     4.3\n",
       "10    4.4\n",
       "11    4.5\n",
       "12    4.6\n",
       "13    4.7\n",
       "14    4.8\n",
       "15    5.1\n",
       "16    5.4\n",
       "17    5.8\n",
       "18    6.1\n",
       "19    6.4\n",
       "Name: 成绩, dtype: float64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score_table['男1000米跑']['成绩'] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "50174c26",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 获取分钟数\n",
    "score_table_min_w = score_table['女800米跑']['成绩'].str.replace('\"','')\\\n",
    "                                                   .map(convert).str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:int(x))[0]\n",
    "# 获取秒转换为分钟数\n",
    "score_table_sec_w = score_table['女800米跑']['成绩'].str.replace('\"','')\\\n",
    "                                                   .map(convert).str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:int(x))[1] / 60\n",
    "score_table.loc[:,('女800米跑','成绩')] = score_table_min_w + score_table_sec_w.round(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "ef400db4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     3.4\n",
       "1     3.5\n",
       "2     3.6\n",
       "3     3.7\n",
       "4     3.8\n",
       "5     3.9\n",
       "6     4.0\n",
       "7     4.1\n",
       "8     4.2\n",
       "9     4.2\n",
       "10    4.3\n",
       "11    4.4\n",
       "12    4.5\n",
       "13    4.6\n",
       "14    4.7\n",
       "15    4.8\n",
       "16    5.0\n",
       "17    5.2\n",
       "18    5.3\n",
       "19    5.5\n",
       "Name: 成绩, dtype: float64"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score_table['女800米跑']['成绩']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "d7c99523",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 其他所有数值类型的值， 都要转换为 float 类型的值\n",
    "test_m.loc[:,'男50米跑':] = test_m.loc[:,'男50米跑':].applymap(lambda x:float(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "7bf1fa57",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "index        int64\n",
       "班级           int64\n",
       "性别          object\n",
       "男1000米跑    float64\n",
       "男50米跑      float64\n",
       "男跳远        float64\n",
       "男体前屈       float64\n",
       "男引体        float64\n",
       "男肺活量       float64\n",
       "身高         float64\n",
       "体重         float64\n",
       "BMI        float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "f17e8020",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   index  班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重  BMI\n",
       "0      0   1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3    0\n",
       "1      1   1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6    0\n",
       "2      2   1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0    0\n",
       "3      3   1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7    0\n",
       "4      4   1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9    0"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "9852fd93",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2785.0</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.3</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>3133.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3901.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4946.0</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.7</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>3538.0</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   index  班级 性别  男1000米跑  男50米跑    男跳远  男体前屈  男引体    男肺活量     身高    体重  BMI\n",
       "0      0   1  男      4.2   8.88  195.0  12.0  1.0  2785.0  170.0  72.6  0.0\n",
       "1      1   1  男      4.3   7.70  225.0  11.0  7.0  3133.0  174.0  52.7  0.0\n",
       "2      2   1  男      4.2   8.45  218.0  14.0  1.0  3901.0  169.0  46.5  0.0\n",
       "3      3   1  男      4.4   8.05  206.0  13.0  1.0  4946.0  183.0  79.7  0.0\n",
       "4      4   1  男      3.7   7.52  210.0  13.0  9.0  3538.0  171.0  54.7  0.0"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "c3450a7e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">男肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男体前屈</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女跳远</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男引体</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女仰卧</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男1000米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女800米跑</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>...</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3.5</td>\n",
       "      <td>100</td>\n",
       "      <td>3.4</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3.6</td>\n",
       "      <td>95</td>\n",
       "      <td>3.5</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3.7</td>\n",
       "      <td>90</td>\n",
       "      <td>3.6</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3.8</td>\n",
       "      <td>85</td>\n",
       "      <td>3.7</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3.9</td>\n",
       "      <td>80</td>\n",
       "      <td>3.8</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   男肺活量       女肺活量      男50米跑      女50米跑       男体前屈       ...  女跳远        男引体  \\\n",
       "     成绩   分数    成绩   分数    成绩   分数    成绩   分数    成绩   分数  ...   成绩   分数    成绩   \n",
       "0  4540  100  3150  100   7.1  100   7.8  100  23.6  100  ...  204  100  16.0   \n",
       "1  4420   95  3100   95   7.2   95   7.9   95  21.5   95  ...  198   95  15.0   \n",
       "2  4300   90  3050   90   7.3   90   8.0   90  19.4   90  ...  192   90  14.0   \n",
       "3  4050   85  2900   85   7.4   85   8.3   85  17.2   85  ...  185   85  13.0   \n",
       "4  3800   80  2750   80   7.5   80   8.6   80  15.0   80  ...  178   80  12.0   \n",
       "\n",
       "       女仰卧      男1000米跑      女800米跑       \n",
       "    分数  成绩   分数      成绩   分数     成绩   分数  \n",
       "0  100  53  100     3.5  100    3.4  100  \n",
       "1   95  51   95     3.6   95    3.5   95  \n",
       "2   90  49   90     3.7   90    3.6   90  \n",
       "3   85  46   85     3.8   85    3.7   85  \n",
       "4   80  43   80     3.9   80    3.8   80  \n",
       "\n",
       "[5 rows x 24 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score_table.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "30e979a3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# BMI=体重(以千克为单位)除以身高的平方(以米为单位)\n",
    "test_m['BMI'] = (test_m['体重'] / ((test_m['身高'] / 100) ** 2)).round(1)\n",
    "test_w['BMI'] = (test_w['体重'] / ((test_w['身高'] / 100) ** 2)).round(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "947b323a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2785.0</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.3</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>3133.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3901.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4946.0</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.7</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>3538.0</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>468</th>\n",
       "      <td>471</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8.76</td>\n",
       "      <td>200.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>4533.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>469</th>\n",
       "      <td>472</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>8.27</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4647.0</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>22.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>470</th>\n",
       "      <td>473</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.3</td>\n",
       "      <td>9.55</td>\n",
       "      <td>210.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>7042.0</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>24.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>471</th>\n",
       "      <td>474</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3.4</td>\n",
       "      <td>7.50</td>\n",
       "      <td>252.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>5755.0</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>19.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>475</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.6</td>\n",
       "      <td>7.81</td>\n",
       "      <td>208.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>5688.0</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>17.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>473 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index  班级 性别  男1000米跑  男50米跑    男跳远  男体前屈   男引体    男肺活量     身高    体重  \\\n",
       "0        0   1  男      4.2   8.88  195.0  12.0   1.0  2785.0  170.0  72.6   \n",
       "1        1   1  男      4.3   7.70  225.0  11.0   7.0  3133.0  174.0  52.7   \n",
       "2        2   1  男      4.2   8.45  218.0  14.0   1.0  3901.0  169.0  46.5   \n",
       "3        3   1  男      4.4   8.05  206.0  13.0   1.0  4946.0  183.0  79.7   \n",
       "4        4   1  男      3.7   7.52  210.0  13.0   9.0  3538.0  171.0  54.7   \n",
       "..     ...  .. ..      ...    ...    ...   ...   ...     ...    ...   ...   \n",
       "468    471  17  男      5.0   8.76  200.0  12.0   9.0  4533.0  169.0  51.3   \n",
       "469    472  17  男      4.4   8.27  208.0  10.0   0.0  4647.0  176.0  69.5   \n",
       "470    473  17  男      5.3   9.55  210.0  15.0   6.0  7042.0  177.0  76.0   \n",
       "471    474  17  男      3.4   7.50  252.0  13.0  13.0  5755.0  181.0  65.0   \n",
       "472    475  17  男      4.6   7.81  208.0  14.0  11.0  5688.0  172.0  51.7   \n",
       "\n",
       "      BMI  \n",
       "0    25.1  \n",
       "1    17.4  \n",
       "2    16.3  \n",
       "3    23.8  \n",
       "4    18.7  \n",
       "..    ...  \n",
       "468  18.0  \n",
       "469  22.4  \n",
       "470  24.3  \n",
       "471  19.8  \n",
       "472  17.5  \n",
       "\n",
       "[473 rows x 12 columns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "283c47bc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>24.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>586</th>\n",
       "      <td>588</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>9.60</td>\n",
       "      <td>150.0</td>\n",
       "      <td>24</td>\n",
       "      <td>41</td>\n",
       "      <td>2255</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>19.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>587</th>\n",
       "      <td>589</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.00</td>\n",
       "      <td>10.18</td>\n",
       "      <td>150.0</td>\n",
       "      <td>13</td>\n",
       "      <td>36</td>\n",
       "      <td>2937</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>21.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>590</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>10.18</td>\n",
       "      <td>152.0</td>\n",
       "      <td>15</td>\n",
       "      <td>35</td>\n",
       "      <td>2592</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>17.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>591</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.01</td>\n",
       "      <td>9.67</td>\n",
       "      <td>165.0</td>\n",
       "      <td>10</td>\n",
       "      <td>41</td>\n",
       "      <td>1829</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>18.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>592</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.48</td>\n",
       "      <td>9.09</td>\n",
       "      <td>180.0</td>\n",
       "      <td>10</td>\n",
       "      <td>46</td>\n",
       "      <td>2962</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>21.1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>591 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index  班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重   BMI\n",
       "0        0   1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3  19.3\n",
       "1        1   1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6  25.1\n",
       "2        2   1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0  24.3\n",
       "3        3   1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7  19.8\n",
       "4        4   1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9  22.9\n",
       "..     ...  .. ..     ...    ...    ...   ...  ...   ...    ...   ...   ...\n",
       "586    588  17  女    3.51   9.60  150.0    24   41  2255  158.0  49.0  19.6\n",
       "587    589  17  女    4.00  10.18  150.0    13   36  2937  161.0  55.7  21.5\n",
       "588    590  17  女    3.45  10.18  152.0    15   35  2592  165.0  48.6  17.9\n",
       "589    591  17  女    4.01   9.67  165.0    10   41  1829  154.0  43.6  18.4\n",
       "590    592  17  女    4.48   9.09  180.0    10   46  2962  162.0  55.3  21.1\n",
       "\n",
       "[591 rows x 12 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "2671916c",
   "metadata": {},
   "outputs": [],
   "source": [
    "test_m['男1000米跑分数'] = pd.cut(test_m['男1000米跑'],\n",
    "                                  bins= [3,3.5,3.6,3.7,3.8,3.9,4,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,5.1,5.4,5.8,6.1,6.4],\n",
    "                                  labels=[100,95,90,85,80,78,76,72,70,68,66,64,62,60,50,40,30,20,10])\n",
    "test_m['男50米跑分数'] = pd.cut(test_m['男50米跑'],\n",
    "                                  bins= [5,7.1,7.2,7.3,7.4,7.5,7.7,7.9,8.1,8.3,8.5,8.7,8.9,9.1,9.3,9.5,9.7,9.9,10.1,10.3,10.5],\n",
    "                                  labels=[100,95,90,85,80,78,76,74,72,70,68,66,64,62,60,50,40,30,20,10])\n",
    "test_m['男跳远分数'] = pd.cut(test_m['男跳远'],\n",
    "                                  bins= [170,175,180,185,190,195,199,203,207,211,215,219,223,227,231,235,243,250,255,260,300],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])\n",
    "test_m['男体前屈分数'] = pd.cut(test_m['男体前屈'],\n",
    "                                  bins= [-6,-3,-2,-1,0,1,2.4,3.8,5.2,6.6,8,9.4,10.8,12.2,13.6,15,17.2,19.4,21.5,23.6,30],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])\n",
    "test_m['男引体分数'] = pd.cut(test_m['男引体'],\n",
    "                                  bins= [0,3,4,5,6,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,13,14,15,16,30],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])\n",
    "test_m['男肺活量分数'] = pd.cut(test_m['男肺活量'],\n",
    "                                  bins= [1000,2080,2210,2340,2470,2600,2720,2840,2960,3080,3200,3320,3440,3560,3680,3800,4050,4300,4420,4540,8000],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "532c01dc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>男跳远分数</th>\n",
       "      <th>男体前屈分数</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>男肺活量分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2785.0</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.1</td>\n",
       "      <td>72</td>\n",
       "      <td>66</td>\n",
       "      <td>50</td>\n",
       "      <td>74</td>\n",
       "      <td>10</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.3</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>3133.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.4</td>\n",
       "      <td>70</td>\n",
       "      <td>78</td>\n",
       "      <td>74</td>\n",
       "      <td>74</td>\n",
       "      <td>50</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3901.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.3</td>\n",
       "      <td>72</td>\n",
       "      <td>70</td>\n",
       "      <td>70</td>\n",
       "      <td>78</td>\n",
       "      <td>10</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4946.0</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.8</td>\n",
       "      <td>68</td>\n",
       "      <td>74</td>\n",
       "      <td>64</td>\n",
       "      <td>76</td>\n",
       "      <td>10</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.7</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>3538.0</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.7</td>\n",
       "      <td>90</td>\n",
       "      <td>78</td>\n",
       "      <td>66</td>\n",
       "      <td>76</td>\n",
       "      <td>66</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>468</th>\n",
       "      <td>471</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8.76</td>\n",
       "      <td>200.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>4533.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>18.0</td>\n",
       "      <td>50</td>\n",
       "      <td>66</td>\n",
       "      <td>62</td>\n",
       "      <td>74</td>\n",
       "      <td>66</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>469</th>\n",
       "      <td>472</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>8.27</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4647.0</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>22.4</td>\n",
       "      <td>68</td>\n",
       "      <td>72</td>\n",
       "      <td>66</td>\n",
       "      <td>72</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>470</th>\n",
       "      <td>473</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.3</td>\n",
       "      <td>9.55</td>\n",
       "      <td>210.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>7042.0</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>24.3</td>\n",
       "      <td>40</td>\n",
       "      <td>50</td>\n",
       "      <td>66</td>\n",
       "      <td>78</td>\n",
       "      <td>40</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>471</th>\n",
       "      <td>474</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3.4</td>\n",
       "      <td>7.50</td>\n",
       "      <td>252.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>5755.0</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>19.8</td>\n",
       "      <td>100</td>\n",
       "      <td>80</td>\n",
       "      <td>90</td>\n",
       "      <td>76</td>\n",
       "      <td>80</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>475</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.6</td>\n",
       "      <td>7.81</td>\n",
       "      <td>208.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>5688.0</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>17.5</td>\n",
       "      <td>64</td>\n",
       "      <td>76</td>\n",
       "      <td>66</td>\n",
       "      <td>78</td>\n",
       "      <td>74</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>473 rows × 18 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index  班级 性别  男1000米跑  男50米跑    男跳远  男体前屈   男引体    男肺活量     身高    体重  \\\n",
       "0        0   1  男      4.2   8.88  195.0  12.0   1.0  2785.0  170.0  72.6   \n",
       "1        1   1  男      4.3   7.70  225.0  11.0   7.0  3133.0  174.0  52.7   \n",
       "2        2   1  男      4.2   8.45  218.0  14.0   1.0  3901.0  169.0  46.5   \n",
       "3        3   1  男      4.4   8.05  206.0  13.0   1.0  4946.0  183.0  79.7   \n",
       "4        4   1  男      3.7   7.52  210.0  13.0   9.0  3538.0  171.0  54.7   \n",
       "..     ...  .. ..      ...    ...    ...   ...   ...     ...    ...   ...   \n",
       "468    471  17  男      5.0   8.76  200.0  12.0   9.0  4533.0  169.0  51.3   \n",
       "469    472  17  男      4.4   8.27  208.0  10.0   0.0  4647.0  176.0  69.5   \n",
       "470    473  17  男      5.3   9.55  210.0  15.0   6.0  7042.0  177.0  76.0   \n",
       "471    474  17  男      3.4   7.50  252.0  13.0  13.0  5755.0  181.0  65.0   \n",
       "472    475  17  男      4.6   7.81  208.0  14.0  11.0  5688.0  172.0  51.7   \n",
       "\n",
       "      BMI 男1000米跑分数 男50米跑分数 男跳远分数 男体前屈分数 男引体分数 男肺活量分数  \n",
       "0    25.1        72      66    50     74    10     62  \n",
       "1    17.4        70      78    74     74    50     68  \n",
       "2    16.3        72      70    70     78    10     80  \n",
       "3    23.8        68      74    64     76    10    100  \n",
       "4    18.7        90      78    66     76    66     74  \n",
       "..    ...       ...     ...   ...    ...   ...    ...  \n",
       "468  18.0        50      66    62     74    66     95  \n",
       "469  22.4        68      72    66     72   NaN    100  \n",
       "470  24.3        40      50    66     78    40    100  \n",
       "471  19.8       100      80    90     76    80    100  \n",
       "472  17.5        64      76    66     78    74    100  \n",
       "\n",
       "[473 rows x 18 columns]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "48e32dfc",
   "metadata": {},
   "outputs": [],
   "source": [
    "test_w['女800米跑分数'] = pd.cut(test_w['女800米跑'],\n",
    "                                  bins= [2.5,3.4,3.5,3.6,3.7,3.8,3.9,4,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,5,5.2,5.3,6],\n",
    "                                  labels=[100,95,90,85,80,78,76,72,70,68,66,64,62,60,50,40,30,20,10])\n",
    "test_w['女50米跑分数'] = pd.cut(test_w['女50米跑'],\n",
    "                                  bins= [5,7.8,7.9,8,8.3,8.6,8.8,9,9.2,9.4,9.6,9.8,10,10.2,10.4,10.6,10.8,11,11.2,11.4,14],\n",
    "                                  labels=[100,95,90,85,80,78,76,74,72,70,68,66,64,62,60,50,40,30,20,10])\n",
    "test_w['女跳远分数'] = pd.cut(test_w['女跳远'],\n",
    "                                  bins= [100,128,133,138,143,148,151,154,157,160,163,166,169,172,175,178,185,192,198,204,230],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])\n",
    "test_w['女体前屈分数'] = pd.cut(test_w['女体前屈'],\n",
    "                                  bins= [0.4,1.2,2,2.8,3.6,4.4,5.7,7,8.3,9.6,10.9,12.2,13.5,14.8,16.1,17.4,19.1,20.8,22.5,24.2,30],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])\n",
    "test_w['女仰卧分数'] = pd.cut(test_w['女仰卧'],\n",
    "                                  bins= [10,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,46,49,51,53,60],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])\n",
    "test_w['女肺活量分数'] = pd.cut(test_w['女肺活量'],\n",
    "                                  bins= [1550,1590,1630,1670,1710,1750,1850,1950,2050,2150,2250,2350,2450,2550,2650,2750,2900,3050,3100,3150,7000],\n",
    "                                  labels=[10,20,30,40,50,60,62,64,66,68,70,72,74,76,78,80,85,90,95,100])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "5d21941e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "      <th>女800米跑分数</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>女体前屈分数</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>女肺活量分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.3</td>\n",
       "      <td>100</td>\n",
       "      <td>72</td>\n",
       "      <td>80</td>\n",
       "      <td>76</td>\n",
       "      <td>85</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.1</td>\n",
       "      <td>62</td>\n",
       "      <td>10</td>\n",
       "      <td>50</td>\n",
       "      <td>66</td>\n",
       "      <td>64</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>24.3</td>\n",
       "      <td>95</td>\n",
       "      <td>10</td>\n",
       "      <td>60</td>\n",
       "      <td>62</td>\n",
       "      <td>76</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.8</td>\n",
       "      <td>100</td>\n",
       "      <td>70</td>\n",
       "      <td>74</td>\n",
       "      <td>90</td>\n",
       "      <td>80</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.9</td>\n",
       "      <td>95</td>\n",
       "      <td>68</td>\n",
       "      <td>50</td>\n",
       "      <td>64</td>\n",
       "      <td>70</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>586</th>\n",
       "      <td>588</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>9.60</td>\n",
       "      <td>150.0</td>\n",
       "      <td>24</td>\n",
       "      <td>41</td>\n",
       "      <td>2255</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>19.6</td>\n",
       "      <td>90</td>\n",
       "      <td>70</td>\n",
       "      <td>60</td>\n",
       "      <td>95</td>\n",
       "      <td>76</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>587</th>\n",
       "      <td>589</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.00</td>\n",
       "      <td>10.18</td>\n",
       "      <td>150.0</td>\n",
       "      <td>13</td>\n",
       "      <td>36</td>\n",
       "      <td>2937</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>21.5</td>\n",
       "      <td>76</td>\n",
       "      <td>64</td>\n",
       "      <td>60</td>\n",
       "      <td>72</td>\n",
       "      <td>72</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>590</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>10.18</td>\n",
       "      <td>152.0</td>\n",
       "      <td>15</td>\n",
       "      <td>35</td>\n",
       "      <td>2592</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>17.9</td>\n",
       "      <td>95</td>\n",
       "      <td>64</td>\n",
       "      <td>62</td>\n",
       "      <td>76</td>\n",
       "      <td>70</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>591</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.01</td>\n",
       "      <td>9.67</td>\n",
       "      <td>165.0</td>\n",
       "      <td>10</td>\n",
       "      <td>41</td>\n",
       "      <td>1829</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>18.4</td>\n",
       "      <td>72</td>\n",
       "      <td>68</td>\n",
       "      <td>70</td>\n",
       "      <td>68</td>\n",
       "      <td>76</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>592</td>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.48</td>\n",
       "      <td>9.09</td>\n",
       "      <td>180.0</td>\n",
       "      <td>10</td>\n",
       "      <td>46</td>\n",
       "      <td>2962</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>21.1</td>\n",
       "      <td>64</td>\n",
       "      <td>74</td>\n",
       "      <td>80</td>\n",
       "      <td>68</td>\n",
       "      <td>80</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>591 rows × 18 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     index  班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重   BMI  \\\n",
       "0        0   1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3  19.3   \n",
       "1        1   1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6  25.1   \n",
       "2        2   1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0  24.3   \n",
       "3        3   1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7  19.8   \n",
       "4        4   1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9  22.9   \n",
       "..     ...  .. ..     ...    ...    ...   ...  ...   ...    ...   ...   ...   \n",
       "586    588  17  女    3.51   9.60  150.0    24   41  2255  158.0  49.0  19.6   \n",
       "587    589  17  女    4.00  10.18  150.0    13   36  2937  161.0  55.7  21.5   \n",
       "588    590  17  女    3.45  10.18  152.0    15   35  2592  165.0  48.6  17.9   \n",
       "589    591  17  女    4.01   9.67  165.0    10   41  1829  154.0  43.6  18.4   \n",
       "590    592  17  女    4.48   9.09  180.0    10   46  2962  162.0  55.3  21.1   \n",
       "\n",
       "    女800米跑分数 女50米跑分数 女跳远分数 女体前屈分数 女仰卧分数 女肺活量分数  \n",
       "0        100      72    80     76    85    100  \n",
       "1         62      10    50     66    64    100  \n",
       "2         95      10    60     62    76    100  \n",
       "3        100      70    74     90    80    100  \n",
       "4         95      68    50     64    70    100  \n",
       "..       ...     ...   ...    ...   ...    ...  \n",
       "586       90      70    60     95    76     70  \n",
       "587       76      64    60     72    72     85  \n",
       "588       95      64    62     76    70     76  \n",
       "589       72      68    70     68    76     60  \n",
       "590       64      74    80     68    80     85  \n",
       "\n",
       "[591 rows x 18 columns]"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "ae99bbac",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男跳远分数</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男体前屈分数</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>男肺活量分数</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>72</td>\n",
       "      <td>8.88</td>\n",
       "      <td>66</td>\n",
       "      <td>195.0</td>\n",
       "      <td>50</td>\n",
       "      <td>12.0</td>\n",
       "      <td>74</td>\n",
       "      <td>1.0</td>\n",
       "      <td>10</td>\n",
       "      <td>2785.0</td>\n",
       "      <td>62</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.3</td>\n",
       "      <td>70</td>\n",
       "      <td>7.70</td>\n",
       "      <td>78</td>\n",
       "      <td>225.0</td>\n",
       "      <td>74</td>\n",
       "      <td>11.0</td>\n",
       "      <td>74</td>\n",
       "      <td>7.0</td>\n",
       "      <td>50</td>\n",
       "      <td>3133.0</td>\n",
       "      <td>68</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.2</td>\n",
       "      <td>72</td>\n",
       "      <td>8.45</td>\n",
       "      <td>70</td>\n",
       "      <td>218.0</td>\n",
       "      <td>70</td>\n",
       "      <td>14.0</td>\n",
       "      <td>78</td>\n",
       "      <td>1.0</td>\n",
       "      <td>10</td>\n",
       "      <td>3901.0</td>\n",
       "      <td>80</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>68</td>\n",
       "      <td>8.05</td>\n",
       "      <td>74</td>\n",
       "      <td>206.0</td>\n",
       "      <td>64</td>\n",
       "      <td>13.0</td>\n",
       "      <td>76</td>\n",
       "      <td>1.0</td>\n",
       "      <td>10</td>\n",
       "      <td>4946.0</td>\n",
       "      <td>100</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.7</td>\n",
       "      <td>90</td>\n",
       "      <td>7.52</td>\n",
       "      <td>78</td>\n",
       "      <td>210.0</td>\n",
       "      <td>66</td>\n",
       "      <td>13.0</td>\n",
       "      <td>76</td>\n",
       "      <td>9.0</td>\n",
       "      <td>66</td>\n",
       "      <td>3538.0</td>\n",
       "      <td>74</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>468</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.0</td>\n",
       "      <td>50</td>\n",
       "      <td>8.76</td>\n",
       "      <td>66</td>\n",
       "      <td>200.0</td>\n",
       "      <td>62</td>\n",
       "      <td>12.0</td>\n",
       "      <td>74</td>\n",
       "      <td>9.0</td>\n",
       "      <td>66</td>\n",
       "      <td>4533.0</td>\n",
       "      <td>95</td>\n",
       "      <td>169.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>469</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.4</td>\n",
       "      <td>68</td>\n",
       "      <td>8.27</td>\n",
       "      <td>72</td>\n",
       "      <td>208.0</td>\n",
       "      <td>66</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4647.0</td>\n",
       "      <td>100</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>22.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>470</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.3</td>\n",
       "      <td>40</td>\n",
       "      <td>9.55</td>\n",
       "      <td>50</td>\n",
       "      <td>210.0</td>\n",
       "      <td>66</td>\n",
       "      <td>15.0</td>\n",
       "      <td>78</td>\n",
       "      <td>6.0</td>\n",
       "      <td>40</td>\n",
       "      <td>7042.0</td>\n",
       "      <td>100</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>24.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>471</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3.4</td>\n",
       "      <td>100</td>\n",
       "      <td>7.50</td>\n",
       "      <td>80</td>\n",
       "      <td>252.0</td>\n",
       "      <td>90</td>\n",
       "      <td>13.0</td>\n",
       "      <td>76</td>\n",
       "      <td>13.0</td>\n",
       "      <td>80</td>\n",
       "      <td>5755.0</td>\n",
       "      <td>100</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>19.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.6</td>\n",
       "      <td>64</td>\n",
       "      <td>7.81</td>\n",
       "      <td>76</td>\n",
       "      <td>208.0</td>\n",
       "      <td>66</td>\n",
       "      <td>14.0</td>\n",
       "      <td>78</td>\n",
       "      <td>11.0</td>\n",
       "      <td>74</td>\n",
       "      <td>5688.0</td>\n",
       "      <td>100</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>17.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>473 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  男1000米跑 男1000米跑分数  男50米跑 男50米跑分数    男跳远 男跳远分数  男体前屈 男体前屈分数   男引体  \\\n",
       "0     1  男      4.2        72   8.88      66  195.0    50  12.0     74   1.0   \n",
       "1     1  男      4.3        70   7.70      78  225.0    74  11.0     74   7.0   \n",
       "2     1  男      4.2        72   8.45      70  218.0    70  14.0     78   1.0   \n",
       "3     1  男      4.4        68   8.05      74  206.0    64  13.0     76   1.0   \n",
       "4     1  男      3.7        90   7.52      78  210.0    66  13.0     76   9.0   \n",
       "..   .. ..      ...       ...    ...     ...    ...   ...   ...    ...   ...   \n",
       "468  17  男      5.0        50   8.76      66  200.0    62  12.0     74   9.0   \n",
       "469  17  男      4.4        68   8.27      72  208.0    66  10.0     72   0.0   \n",
       "470  17  男      5.3        40   9.55      50  210.0    66  15.0     78   6.0   \n",
       "471  17  男      3.4       100   7.50      80  252.0    90  13.0     76  13.0   \n",
       "472  17  男      4.6        64   7.81      76  208.0    66  14.0     78  11.0   \n",
       "\n",
       "    男引体分数    男肺活量 男肺活量分数     身高    体重   BMI  \n",
       "0      10  2785.0     62  170.0  72.6  25.1  \n",
       "1      50  3133.0     68  174.0  52.7  17.4  \n",
       "2      10  3901.0     80  169.0  46.5  16.3  \n",
       "3      10  4946.0    100  183.0  79.7  23.8  \n",
       "4      66  3538.0     74  171.0  54.7  18.7  \n",
       "..    ...     ...    ...    ...   ...   ...  \n",
       "468    66  4533.0     95  169.0  51.3  18.0  \n",
       "469   NaN  4647.0    100  176.0  69.5  22.4  \n",
       "470    40  7042.0    100  177.0  76.0  24.3  \n",
       "471    80  5755.0    100  181.0  65.0  19.8  \n",
       "472    74  5688.0    100  172.0  51.7  17.5  \n",
       "\n",
       "[473 rows x 17 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_m = test_m[['班级','性别','男1000米跑','男1000米跑分数','男50米跑','男50米跑分数','男跳远','男跳远分数','男体前屈','男体前屈分数','男引体','男引体分数','男肺活量','男肺活量分数','身高','体重','BMI']]\n",
    "test_m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "abcc4a9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女800米跑分数</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女体前屈分数</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>女肺活量分数</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>100</td>\n",
       "      <td>9.32</td>\n",
       "      <td>72</td>\n",
       "      <td>185.0</td>\n",
       "      <td>80</td>\n",
       "      <td>16</td>\n",
       "      <td>76</td>\n",
       "      <td>48</td>\n",
       "      <td>85</td>\n",
       "      <td>3775</td>\n",
       "      <td>100</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>62</td>\n",
       "      <td>11.44</td>\n",
       "      <td>10</td>\n",
       "      <td>148.0</td>\n",
       "      <td>50</td>\n",
       "      <td>9</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>64</td>\n",
       "      <td>3683</td>\n",
       "      <td>100</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>95</td>\n",
       "      <td>13.40</td>\n",
       "      <td>10</td>\n",
       "      <td>150.0</td>\n",
       "      <td>60</td>\n",
       "      <td>7</td>\n",
       "      <td>62</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3331</td>\n",
       "      <td>100</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>24.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>100</td>\n",
       "      <td>9.52</td>\n",
       "      <td>70</td>\n",
       "      <td>172.0</td>\n",
       "      <td>74</td>\n",
       "      <td>21</td>\n",
       "      <td>90</td>\n",
       "      <td>46</td>\n",
       "      <td>80</td>\n",
       "      <td>3701</td>\n",
       "      <td>100</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>95</td>\n",
       "      <td>9.79</td>\n",
       "      <td>68</td>\n",
       "      <td>145.0</td>\n",
       "      <td>50</td>\n",
       "      <td>8</td>\n",
       "      <td>64</td>\n",
       "      <td>34</td>\n",
       "      <td>70</td>\n",
       "      <td>3592</td>\n",
       "      <td>100</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>586</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>90</td>\n",
       "      <td>9.60</td>\n",
       "      <td>70</td>\n",
       "      <td>150.0</td>\n",
       "      <td>60</td>\n",
       "      <td>24</td>\n",
       "      <td>95</td>\n",
       "      <td>41</td>\n",
       "      <td>76</td>\n",
       "      <td>2255</td>\n",
       "      <td>70</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>19.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>587</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.00</td>\n",
       "      <td>76</td>\n",
       "      <td>10.18</td>\n",
       "      <td>64</td>\n",
       "      <td>150.0</td>\n",
       "      <td>60</td>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>36</td>\n",
       "      <td>72</td>\n",
       "      <td>2937</td>\n",
       "      <td>85</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>21.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>95</td>\n",
       "      <td>10.18</td>\n",
       "      <td>64</td>\n",
       "      <td>152.0</td>\n",
       "      <td>62</td>\n",
       "      <td>15</td>\n",
       "      <td>76</td>\n",
       "      <td>35</td>\n",
       "      <td>70</td>\n",
       "      <td>2592</td>\n",
       "      <td>76</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>17.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.01</td>\n",
       "      <td>72</td>\n",
       "      <td>9.67</td>\n",
       "      <td>68</td>\n",
       "      <td>165.0</td>\n",
       "      <td>70</td>\n",
       "      <td>10</td>\n",
       "      <td>68</td>\n",
       "      <td>41</td>\n",
       "      <td>76</td>\n",
       "      <td>1829</td>\n",
       "      <td>60</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>18.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.48</td>\n",
       "      <td>64</td>\n",
       "      <td>9.09</td>\n",
       "      <td>74</td>\n",
       "      <td>180.0</td>\n",
       "      <td>80</td>\n",
       "      <td>10</td>\n",
       "      <td>68</td>\n",
       "      <td>46</td>\n",
       "      <td>80</td>\n",
       "      <td>2962</td>\n",
       "      <td>85</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>21.1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>591 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  女800米跑 女800米跑分数  女50米跑 女50米跑分数    女跳远 女跳远分数  女体前屈 女体前屈分数  女仰卧  \\\n",
       "0     1  女    3.22      100   9.32      72  185.0    80    16     76   48   \n",
       "1     1  女    4.59       62  11.44      10  148.0    50     9     66   29   \n",
       "2     1  女    3.46       95  13.40      10  150.0    60     7     62   40   \n",
       "3     1  女    3.39      100   9.52      70  172.0    74    21     90   46   \n",
       "4     1  女    3.43       95   9.79      68  145.0    50     8     64   34   \n",
       "..   .. ..     ...      ...    ...     ...    ...   ...   ...    ...  ...   \n",
       "586  17  女    3.51       90   9.60      70  150.0    60    24     95   41   \n",
       "587  17  女    4.00       76  10.18      64  150.0    60    13     72   36   \n",
       "588  17  女    3.45       95  10.18      64  152.0    62    15     76   35   \n",
       "589  17  女    4.01       72   9.67      68  165.0    70    10     68   41   \n",
       "590  17  女    4.48       64   9.09      74  180.0    80    10     68   46   \n",
       "\n",
       "    女仰卧分数  女肺活量 女肺活量分数     身高    体重   BMI  \n",
       "0      85  3775    100  163.0  51.3  19.3  \n",
       "1      64  3683    100  163.0  66.6  25.1  \n",
       "2      76  3331    100  157.0  60.0  24.3  \n",
       "3      80  3701    100  160.0  50.7  19.8  \n",
       "4      70  3592    100  167.0  63.9  22.9  \n",
       "..    ...   ...    ...    ...   ...   ...  \n",
       "586    76  2255     70  158.0  49.0  19.6  \n",
       "587    72  2937     85  161.0  55.7  21.5  \n",
       "588    70  2592     76  165.0  48.6  17.9  \n",
       "589    76  1829     60  154.0  43.6  18.4  \n",
       "590    80  2962     85  162.0  55.3  21.1  \n",
       "\n",
       "[591 rows x 17 columns]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_w = test_w[['班级','性别','女800米跑','女800米跑分数','女50米跑','女50米跑分数','女跳远','女跳远分数','女体前屈','女体前屈分数','女仰卧','女仰卧分数','女肺活量','女肺活量分数','身高','体重','BMI']]\n",
    "test_w"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "670d53ba",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
